import { defineConfig } from "vite";
import { resolve } from 'path'
import uni from "@dcloudio/vite-plugin-uni";
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';

export default defineConfig({
	plugins: [uni()],
	build: {
		rollupOptions: {
			plugins: [
				new BundleAnalyzerPlugin(), 
			],
		},
	},
	server: {
		open: true,
		host: '0.0.0.0',
		proxy: {
			"/api": {
				target: 'http://127.0.0.1:3000/api',
				changeOrigin: true,
				secure: false,
			},
		},
	},
	resolve: {
		alias: {
			'@': resolve(__dirname, 'src'), 
		}
	},
});
